#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
int main(void)
{
pid_t pid;
if((pid=fork())<0)     /*创建新进程*/
{
printf("error\n");
exit (1);
}
else if(pid==0)       /*创建新子进程*/
{
printf(" this is child process %ld\t\n",(long)getpid());
printf("hello world\n");
}
else
{
printf(" this is parent process %ld\t\n",(long)getpid());
printf("welcome to openSUSE!\n");
exit(0);
}
}
